<template>
<view class="file_record-main page-view">
	<view class="pet-info-wrap">
		<image class="head-picture" src="@/static/images/a.jpg"></image>
		<view class="detail">
			<view class="type">金毛</view>
			<view class="sex-age">
				<view>男</view>
				<view></view>
				<view>7岁</view>
			</view>
			<view class="age-like">
				相当于人类8岁
			</view>
		</view>
	</view>
	
	<view class="record-list">
		<view class="item" v-for="(item, index) in list" :key="index">
			<view class="header">
				<view class="label">绝育记录</view>
				<image class="del-btn btn" src="@/static/images/icon/del.png"></image>
			</view>
			<view class="line">
				<view>绝育时间：</view>
				<view>2024.9.32</view>
			</view>
			<view class="line">
				<view>绝育地点：</view>
				<view>广州科韵路22323号兽医医院</view>
			</view>
		</view>
		<view class="add-btn fade-btn" @click="list.push(1)">
			<view class="circle">
				<image src="@/static/images/icon/add-orange.png"></image>
			</view>
			<view class="label">添加绝育记录</view>
		</view>
	</view>
</view>
</template>

<script>
export default {
	data() {
		return {
			// 记录类型
			type: 0,
			// 记录列表
			list: []
		}
	},
	onLoad (params) {
		this.type = parseInt(params.type)
		
		let title = ""
		switch(this.type) {
			case 1: title = "绝育"; break;
			case 2: title = "驱虫"; break;
			case 3: title = "免疫"; break;
			case 4: title = "体检"; break;
		}
		uni.setNavigationBarTitle({ title })
	}
}
</script>

<style lang="less">
.file_record-main {
	overflow-y: auto;
	padding-bottom: 40rpx;
	
	.pet-info-wrap {
		display: flex;
		gap: 20rpx;
		padding: 14rpx 36rpx 24rpx;
		border-bottom: 1rpx solid #F7F9FD;
		
		.head-picture {
			width: 123rpx;
			height: 123rpx;
			border-radius: 100%;
		}
		
		.detail {
			flex: 1;
			
			.type {
				font-size: 36rpx;
				font-weight: bold;
				color: #3D3D3D;
			}
			
			.sex-age {
				margin-top: 10rpx;
				display: flex;
				align-items: center;
				gap: 18rpx;
				
				>view {
					font-size: 24rpx;
					color: #3D3D3D;
					
					&:nth-child(2) {
						width: 1rpx;
						height: 16rpx;
						background: #D8D8D8;
					}
				}
			}
			
			.age-like {
				font-size: 24rpx;
				color: #3D3D3D;
				margin-top: 8rpx;
			}
		}
	}
	
	.record-list {
		padding: 0 40rpx;
		margin-top: 42rpx;
		
		.item, .add-btn {
			transition: .2s;
			&:nth-child(n+2) {
				margin-top: 64rpx;
			}
		}
		
		.item {
			border-radius: 20rpx;
			padding: 40rpx 36rpx 40rpx 30rpx;
			border: 1rpx solid #C4C4C4;

			.header {
				display: flex;
				justify-content: space-between;
				
				.label {
					font-size: 32rpx;
					font-weight: bold;
					line-height: 36rpx;
					color: #FF6D03;
				}
				
				.del-btn {
					width: 32rpx;
					height: 32rpx;
				}
			}
			
			.line {
				display: flex;
				margin-top: 25rpx;
				font-size: 28rpx;
				line-height: 36rpx;
				color: #393938;
				
				>view:nth-child(2) {
					flex: 1;
				}
			}
		}
		
		.add-btn {
			height: 251rpx;
			border-radius: 20rpx;
			display: flex;
			flex-direction: column;
			justify-content: center;
			align-items: center;
			gap: 24rpx;
			background: #F9F9F9;
			
			.circle {
				width: 96rpx;
				height: 96rpx;
				border-radius: 100%;
				display: flex;
				justify-content: center;
				align-items: center;
				background: #FFFFFF;
				border: 1rpx solid #E5E5E5;
				
				>image {
					width: 28rpx;
					height: 28rpx;
				}
			}
			
			.label {
				font-size: 24rpx;
				line-height: 31rpx;
				color: #99A3B2;
			}
		}
	}
}
</style>
